/**********************************************************************************************************************
*  COPYRIGHT
*  -------------------------------------------------------------------------------------------------------------------
*  Copyright (c) 2016 by Vector Informatik GmbH.                                                  All rights reserved.
*
*                This software is copyright protected and proprietary to Vector Informatik GmbH.
*                Vector Informatik GmbH grants to you only those rights as set out in the license conditions.
*                All other rights remain with Vector Informatik GmbH.
*  -------------------------------------------------------------------------------------------------------------------
*  FILE DESCRIPTION
*  -------------------------------------------------------------------------------------------------------------------
*  File       :  Il_AsrComCfg5.plugin
*  Module     :  MSSV
*
*  Description:  Entry point of MSSV Core.
*
*  -------------------------------------------------------------------------------------------------------------------
*  AUTHOR IDENTITY
*  -------------------------------------------------------------------------------------------------------------------
*  Name                          Initials      Company
*  -------------------------------------------------------------------------------------------------------------------
*  Gunnar Meiss                  visms         Vector Informatik GmbH
*  Anant Gupta                   visgut        Vector Informatik GmbH  
*
*  -------------------------------------------------------------------------------------------------------------------
*  REVISION HISTORY
*  -------------------------------------------------------------------------------------------------------------------
*  Version    Date          Author   Change Id        Description
*  -------------------------------------------------------------------------------------------------------------------
*  01.00.00   2016-04-25    visms    ESCAN00089733    FEAT-1688: SafeBSW Step 4
*  02.00.00   2016-11-08    visgut   FEATC-275        FEAT-1920: SafeBSW Step 6
*
**********************************************************************************************************************/

/**********************************************************************************************************************
* Mandatory Functions
**********************************************************************************************************************/

/**********************************************************************************************************************
* Name         : RegisterPlugin
* Return value : Reference to a structure which contains the registration information about the plugin
* Description  : MSSV_core calls this function to query necessary information about the plugin.
*                This function is mandatory.
**********************************************************************************************************************/
def RegisterPlugin()
{
  var reg = ModulePluginRegistration()
  reg.SetVersion(0x010000)
  reg.SetPackageName("Il_AsrComCfg5")
  reg.SetInputFiles(["Com.c", "Com_Lcfg.c", "Com_PBcfg.c"])
  return reg
}

/**********************************************************************************************************************
* Name         : main
* Parameter    : None
* Return value : None
* Description  : This is the entry point of the MSSV plugin. main calls all rule functions to check the configuration.
*                This function is mandatory.
* Requirements : N/A
**********************************************************************************************************************/
def main()
{
  InvokeRule("Check QM inactive", CheckQMDefines)
}

/**********************************************************************************************************************
* Name         : CheckQMDefines
* Parameter    : None
* Return value : None
* Description  : This rule checks the setting of QM-related preprocessor defines.
*                Typically it checks that QM features are inactive in safety context.
* Requirements : N/A
**********************************************************************************************************************/
def CheckQMDefines()
{
  /* Parameter Checks shall be enabled */
  AssertDefineIsStdOn("COM_DEV_ERROR_DETECT")
  
  /* /MICROSAR/PduR/PduRBswModules/PduRCommunicationInterface[Com] shall be configured to TRUE */
  AssertDefineIsStdOn("COM_COMMUNICATION_INTERFACE")
  
  /* /MICROSAR/Com/ComGeneral/ComReceiveSignalMacroAPI shall be configured to FALSE */
  AssertDefineIsStdOff("COM_RECEIVE_SIGNAL_MACRO_API")
  
  /* /MICROSAR/Com/ComGeneral/ComMetaDataSupport shall be configured to FALSE */
  AssertDefineIsStdOff("COM_TRIGGER_IPDU_SEND_WITH_META_DATA_API")
  AssertDefineIsStdOff("COM_TXBUFFERMETADATAUSEDOFTXPDUINFO")
  AssertDefineIsStdOff("COM_TXPDUINITVALUEMETADATAUSEDOFTXPDUINFO")
  
  /* /MICROSAR/Com/ComGeneral/ComDescriptionRoutingCodeGeneration shall be configured to FALSE */
  AssertDefineIsStdOff("COM_GENERATED_DESCRIPTION_ROUTING")
  AssertDefineIsStdOff("COM_DEFERREDGWMAPPINGINFOUSEDOFRXPDUINFO")
    
  /* /MICROSAR/PduR/PduRBswModules/PduRCancelTransmit[Com] shall be configured to FALSE */
  AssertDefineIsStdOff("COM_CANCELLATIONSUPPORTOFTXPDUINFO")
  
  /* /MICROSAR/PduR/PduRBswModules/PduRTransportProtocol[Com] shall be configured to FALSE */
  AssertDefineIsStdOff("COM_TRANSPORT_PROTOCOL")

  AssertDefineIsStdOff("COM_RXTPINFO")
  
  AssertDefineIsStdOff("COM_RXTPINFOUSEDOFRXPDUINFO")
  AssertDefineIsStdOff("COM_RXTPINFOIDXOFRXPDUINFO")
  
  AssertDefineIsStdOff("COM_RXDYNSIGNALTMPLENGTHFORSIGNALGROUPS")
  
  AssertDefineIsStdOff("COM_TXTPINFO")
  AssertDefineIsStdOff("COM_TXSIGINFODYNSIGUSEDOFTXTPINFO")
  
  AssertDefineIsStdOff("COM_TXTPINFOUSEDOFTXPDUINFO")
  AssertDefineIsStdOff("COM_TXTPINFOIDXOFTXPDUINFO")

}

/**********************************************************************************************************************
* Name         : CheckVersions
* Return value : -
* Description  : MSSV_core calls this function to allow the plugin a version check against the BSW sources.
*                Check against the major and minor version of the source code.
*                Note: The version check is not necessary if only rule CheckQMDefines is implemented in this plugin.
**********************************************************************************************************************/
def CheckVersions()
{
}


